package com.lingyun.ucm.client.config.springext;

import java.util.Properties;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.core.PriorityOrdered;

/**
 * 
 * @author Terrence2013
 * 2018年1月24日 下午2:30:33
 * TODO
 */
public abstract class ZookeeperResourceConfigurer extends ZookeeperPropertiesLoaderSupport implements BeanFactoryPostProcessor,
		PriorityOrdered {
	
	@Override
	public int getOrder() {
		return 0;
	}

	@Override
	public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
		Properties properties  = loadProperties();
		processProperties(beanFactory,properties);
	}

	protected abstract void processProperties(ConfigurableListableBeanFactory beanFactory, Properties props)throws BeansException;

}
